Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move pod jobs to parallel execution #7382

Merged
merged 2 commits into from
Oct 7, 2020

Conversation

mheon
Copy link
Member

@mheon mheon commented Aug 19, 2020

Make Podman pod operations that do not involve starting containers (which needs to be done in a specific order) use the same parallel operation code we use to make podman stop on large numbers of containers fast. We were previously stopping containers in a pod serially, which could take up to the timeout (default 15 seconds) for each container - stopping 100 containers that do not respond to SIGTERM would take 25 minutes.

To do this, refactor the parallel operation code a bit to remove its dependency on libpod (damn circular import restrictions...) and use parallel functions that just re-use the standard container API operations - maximizes code reuse (previously each pod handler had a separate implementation of the container function it performed).

This is a bit of a palate cleanser after fighting CI for two days - nice to be able to return to a land of sanity.

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mheon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 19, 2020
@mheon mheon force-pushed the pod_parallel branch 4 times, most recently from 93b045a to 51d10eb Compare August 20, 2020 15:10
@mheon mheon force-pushed the pod_parallel branch 2 times, most recently from 51b555a to 2684f0f Compare September 17, 2020 17:08
@@ -0,0 +1,42 @@
package parallelctr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why stutter name on enclosing directory and file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I am not very creative and could not think of a better name.

@mheon mheon force-pushed the pod_parallel branch 4 times, most recently from 230a495 to e2c8595 Compare October 6, 2020 23:24
mheon and others added 2 commits October 7, 2020 10:00
Make Podman pod operations that do not involve starting
containers (which needs to be done in a specific order) use the
same parallel operation code we use to make `podman stop` on
large numbers of containers fast. We were previously stopping
containers in a pod serially, which could take up to the timeout
(default 15 seconds) for each container - stopping 100 containers
that do not respond to SIGTERM would take 25 minutes.

To do this, refactor the parallel operation code a bit to remove
its dependency on libpod (damn circular import restrictions...)
and use parallel functions that just re-use the standard
container API operations - maximizes code reuse (previously each
pod handler had a separate implementation of the container
function it performed).

This is a bit of a palate cleanser after fighting CI for two
days - nice to be able to return to a land of sanity.

Signed-off-by: Matthew Heon <[email protected]>
Ensure that we actually print the output of all commands when
cleaning up the results of the E2E tests.

Signed-off-by: Matthew Heon <[email protected]>
@mheon
Copy link
Member Author

mheon commented Oct 7, 2020

This should (finally) go green now

@mheon
Copy link
Member Author

mheon commented Oct 7, 2020

It's green. @baude @rhatdan @vrothberg @TomSweeneyRedHat @jwhonce PTAL

}()

return retChan
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really neat function. At first I was looking all over above for the channel close.

@TomSweeneyRedHat
Copy link
Member

LGTM

@baude
Copy link
Member

baude commented Oct 7, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 7, 2020
@openshift-merge-robot openshift-merge-robot merged commit 0e1d011 into containers:master Oct 7, 2020
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants